package com.nulldev.util.web.YouTubeExtractor.Qtraxtor;

import java.util.AbstractMap;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;

import com.nulldev.util.data.Arrays.maps.FastMaps;

public class ExtractedSet extends AbstractMap<String, String> {

	private final Map<String, String> values = FastMaps.map();

	public ExtractedSet() {
		super();
	}

	protected void add(final String key, final String value) {
		this.values.put(key, value);
	}

	public Map<String, String> get() {
		return this.values;
	}

	@Override
	public String toString() {
		return "ExtractedSet[values=" + this.values + "]";
	}

	public boolean __add_if_possible(final String key, final String value) {
		if (!this.values.containsKey(key)) {
			this.values.put(key, value);
			return true;
		}
		return false;
	}

	@Override
	public Set<Entry<String, String>> entrySet() {
		return this.values.entrySet();
	}

	@Override
	public String get(Object key) {
		return this.values.get(key);
	}

	@Override
	public boolean containsKey(Object key) {
		return this.values.containsKey(key);
	}

	@Override
	public boolean containsValue(Object value) {
		return this.values.containsValue(value);
	}

	@Override
	public void clear() {
		this.values.clear();
	}

	@Override
	public void forEach(BiConsumer<? super String, ? super String> action) {
		this.values.forEach(action);
	}

	@Override
	public String getOrDefault(Object key, String defaultValue) {
		return this.values.getOrDefault(key, defaultValue);
	}

	@Override
	public int size() {
		return this.values.size();
	}

	@Override
	public boolean isEmpty() {
		return this.values.isEmpty();
	}

	@Override
	public Set<String> keySet() {
		return this.values.keySet();
	}

	@Override
	public Collection<String> values() {
		return this.values.values();
	}

	@Override
	public String put(String key, String value) {
		return this.values.put(key, value);
	}

	@Override
	public String remove(Object key) {
		return this.values.get(key);
	}

	@Override
	public boolean remove(Object key, Object value) {
		return this.values.remove(key, value);
	}

	@Override
	public String compute(String key, BiFunction<? super String, ? super String, ? extends String> remappingFunction) {
		return this.values.compute(key, remappingFunction);
	}

	@Override
	public String putIfAbsent(String key, String value) {
		return this.values.putIfAbsent(key, value);
	}

	@Override
	public String merge(String key, String value, BiFunction<? super String, ? super String, ? extends String> remappingFunction) {
		return this.values.merge(key, value, remappingFunction);
	}

	@Override
	public void putAll(Map<? extends String, ? extends String> m) {
		this.values.putAll(m);
	}

	@Override
	public String computeIfAbsent(String key, Function<? super String, ? extends String> mappingFunction) {
		return this.values.computeIfAbsent(key, mappingFunction);
	}

	@Override
	public String computeIfPresent(String key, BiFunction<? super String, ? super String, ? extends String> remappingFunction) {
		return this.values.computeIfPresent(key, remappingFunction);
	}

	@Override
	public boolean replace(String key, String oldValue, String newValue) {
		return this.values.replace(key, oldValue, newValue);
	}

	@Override
	public String replace(String key, String value) {
		return this.values.replace(key, value);
	}

	@Override
	public void replaceAll(BiFunction<? super String, ? super String, ? extends String> function) {
		this.values.replaceAll(function);
	}
}
